<?php echo form_open_multipart('training/edittouchbase/'.$data->TouchBaseID,array('class'=>'form-horizontal','id'=>'frm'));?>
    <? echo $formsavetouchbase;?>
    <fieldset>
    <legend><h4><?php echo $title;?></h4></legend>
    <input type="hidden" value="<? echo $data->TouchBaseID;?>" name="TouchBaseID"/>
    <div class="control-group">
	    <label class="control-label">Date Touch Base *</label>
	    <div class="controls">
	      <input type="text" name="DateTouchBase" value="<? echo date("Y-m-d", strtotime($data->DateTouchBase));?>" class="validate[required] datepicker"/>
	    </div>
  	</div>
    <div class="control-group">
	    <label class="control-label">Staff Name *</label>
	    <div class="controls">
          <select name="StaffID" class="validate[required]">
                <?php 
                    foreach ($staffname->result() as $row){
                        $select= $row->StaffID == $data->StaffID ? "selected":"";
                        echo '<option value="'.$row->StaffID.'" '.$select.'>'.$row->staffname.'</option>';   
                    }
                ?>
          </select>
	    </div>
  	</div>
    <div class="control-group">
	    <label class="control-label">Location *</label>
	    <div class="controls">
	      <select name="Location" class="validate[required]">
                <?php 
                    foreach ($location->result() as $row){
                        $select= $row->LocationID == $data->LocationID ? "selected":"";
                        echo '<option value="'.$row->LocationID.'" '.$select.'>'.$row->Location.'</option>';   
                    }
                ?>
          </select>
	    </div>
  	</div>
    <div class="control-group">
	    <label class="control-label">Course *</label>
	    <div class="controls">
	      <input type="text" name="Course" value="<? echo $data->Course;?>" class="validate[required]"/>
	    </div>
  	</div>
    <div class="control-group">
	    <label class="control-label">Duration</label>
	    <div class="controls">
	      <input type="text" name="Duration"  value="<? echo $data->Duration;?>" class="validate[required]"/>
	    </div>
  	</div>
    <div class="control-group">
	    <label class="control-label">Purpose</label>
	    <div class="controls">
	      <input type="text" name="Purpose" value="<? echo $data->Purpose;?>" class="validate[required]"/>
	    </div>
  	</div>
    <div class="control-group">
	    <label class="control-label">Comment</label>
	    <div class="controls">
          <textarea name="Comment" rows="3"><? echo $data->Comment;?></textarea>
	    </div>
  	</div>
    </fieldset>
<?php echo form_close();?>